---
title: "G-g Story Plots"
format: html
editor: visual
---
Purpose: build visual story plots for each basin and climate year
Notes:
- For Shields and Snake, yield from NWIS gages (medium g) is way greater than yield from little g...need to check raw flow data and basin sizes used to calculate yield. Does NWIS basin size match delineated basin size? wtf...
```{r, include = FALSE}
library(tidyverse)
library(zoo)
library(RColorBrewer)
library(sf)
library(mapview)
library(fasstr)
library(ggpubr)
library(gganimate)
library(fmsb)
library(nhdplusTools)
library(terra)
library(dygraphs)
library(ggforce)
library(ggspatial)
```
## Site info and daily data
View map of sites
```{r}
# site information and locations
siteinfo <- read_csv ("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/EcoDrought_SiteInformation.csv" )
siteinfo_sp <- st_as_sf (siteinfo, coords = c ("long" , "lat" ), crs = 4326 )
mapview (siteinfo_sp, zcol = "designation" )
```
Load and view data structure
```{r}
# flow/yield (and temp) data
dat <- read_csv ("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/EcoDrought_FlowTempData_DailyWeekly.csv" ) %>% filter (! site_name %in% c ("Wounded Buck Creek" ))
# add water/climate year variables
dat <- add_date_variables (dat, dates = date, water_year_start = 4 )
# calculate completeness by site and water year
complete <- dat %>% group_by (site_name, designation, WaterYear) %>% summarize (completeness = sum (! is.na (Yield_filled_mm_7))/ 365 )
dat <- dat %>% left_join (complete)
str (dat)
```
View little and medium g time series data (yield), by basin and site
```{r}
mysubbasins <- unique (dat$ subbasin)[- c (4 ,5 ,9 )]
myplots <- list ()
for (i in 1 : length (mysubbasins)) {
myplots[[i]] <- dat %>% filter (designation %in% c ("little" , "medium" ), subbasin == mysubbasins[i]) %>% ggplot () + geom_line (aes (x = date, y = log (Yield_filled_mm_7))) + facet_wrap (~ site_name)
}
```
::: panel-tabset
#### Big Creek
```{r, echo=FALSE}
myplots[[1]]
```
#### Coal Creek
```{r, echo=FALSE}
myplots[[2]]
```
#### McGee Creek
```{r, echo=FALSE}
myplots[[3]]
```
#### West Brook
```{r, echo=FALSE}
myplots[[4]]
```
#### Donner Blitzen
```{r, echo=FALSE}
myplots[[5]]
```
#### Paine Run
```{r, echo=FALSE}
myplots[[6]]
```
#### Staunton River
```{r, echo=FALSE}
myplots[[7]]
```
#### Duck Creek
```{r, echo=FALSE}
myplots[[8]]
```
#### Shields River
```{r, echo=FALSE}
myplots[[9]]
```
#### Snake River
```{r, echo=FALSE}
myplots[[10]]
```
:::
View little and medium g time series data (yield), by basin. Use the handles below the x-axis to change the time frame.
```{r}
mysubbasins <- unique (dat$ subbasin)[- c (4 ,5 ,9 )]
myplots <- list ()
for (i in 1 : length (mysubbasins)) {
myplots[[i]] <- dat %>% filter (designation %in% c ("little" , "medium" ), subbasin == mysubbasins[i]) %>% mutate (logYield = log (Yield_filled_mm_7)) %>% select (date, site_name, logYield) %>% spread (key = site_name, value = logYield) %>% dygraph () %>% dyRangeSelector () %>% dyAxis ("y" , label = "ln(Yield, mm)" )
}
```
::: panel-tabset
#### Big Creek
```{r, echo=FALSE}
myplots[[1]]
```
#### Coal Creek
```{r, echo=FALSE}
myplots[[2]]
```
#### McGee Creek
```{r, echo=FALSE}
myplots[[3]]
```
#### West Brook
```{r, echo=FALSE}
myplots[[4]]
```
#### Donner Blitzen
```{r, echo=FALSE}
myplots[[5]]
```
#### Paine Run
```{r, echo=FALSE}
myplots[[6]]
```
#### Staunton River
```{r, echo=FALSE}
myplots[[7]]
```
#### Duck Creek
```{r, echo=FALSE}
myplots[[8]]
```
#### Shields River
```{r, echo=FALSE}
myplots[[9]]
```
#### Snake River
```{r, echo=FALSE}
myplots[[10]]
```
:::
## Create plotting functions
Write functions to generate residual time series/scatter plot
```{r}
residualplots <- function (mybasin, CY, little, big) {
# essential elements
dat_basin <- dat %>% filter (basin == mybasin)
# create residual data frame
delta_dat <- dat_basin %>% select (site_name, site_id, basin, region, designation, date, WaterYear, Yield_mm_mean_7) %>% filter (site_name %in% little, WaterYear == CY) %>%
left_join (dat_basin %>% select (basin, site_name, date, WaterYear, Yield_mm_mean_7) %>% filter (site_name == big, WaterYear == CY) %>% rename (bigyield = Yield_mm_mean_7) %>% select (- site_name)) %>%
mutate (delta_yield = log (Yield_mm_mean_7) - log (bigyield), site_name = factor (site_name, levels = little)) %>%
group_by (site_name) %>% mutate (cum_resid = cumsum (coalesce (delta_yield, 0 )) + delta_yield* 0 )
# base plot
p1 <- delta_dat %>%
filter (WaterYear == CY) %>%
group_by (site_name) %>%
mutate (month = month (date), doy = 1 : n ()) %>%
ungroup () %>%
ggplot (aes (x = log (bigyield), y = log (Yield_mm_mean_7), color = doy)) +
geom_abline (intercept = 0 , slope = 1 , linetype = "dashed" ) +
geom_point (aes (group = doy)) +
geom_path () +
scale_color_gradient2 (midpoint = 182 , low = "orange" , mid = "purple3" , high = "orange" ) +
facet_wrap (~ site_name) +
xlab ("Big G ln(Yield)" ) + ylab ("Little G ln(Yield)" ) + labs (color = "Days from April 1" ) +
theme_bw () + theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank ())
# animated
# p1_anim <- p1 + transition_reveal(along = doy)
# write out - static
jpeg (paste ("Big G Little g/Compare Time Series/BigGLittleG_ScatterByTime" , mybasin, "_" , CY, ".jpg" , sep = "" ), height = 10 , width = 12 , units = "in" , res = 500 )
print (p1)
dev.off ()
# write out - animated
# animate(p1_anim, renderer = gifski_renderer(), height = 10, width = 12, units = "in", res = 500)
# anim_save(paste("Big G Little g/Compare Time Series/BigGLittleG_ScatterByTime_Animated_", mybasin, "_", CY, ".gif", sep = ""))
# residual time series
jpeg (paste ("Big G Little g/Compare Time Series/BigGLittleG_YieldResiduals_TimeSeries_" , mybasin, "_" , CY, ".jpg" , sep = "" ), height = 4 , width = 6 , units = "in" , res = 500 )
print (ggplot (data = delta_dat) +
geom_line (aes (x = date, y = delta_yield, group = site_name, color = site_name)) +
geom_hline (aes (yintercept = 0 ), linetype = "dashed" ) +
xlab ("" ) + ylab ("ln(Yield) residuals (difference from Big G)" ) + labs (color = "Little g" ) +
theme_bw () + theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank ()))
dev.off ()
# plot little g cumulative residuals - difference from Big G by site
jpeg (paste ("Big G Little g/Compare Time Series/BigGLittleG_YieldResiduals_Cumulative_TimeSeries_" , mybasin, "_" , CY, ".jpg" , sep = "" ), height = 4 , width = 6 , units = "in" , res = 500 )
print (delta_dat %>%
ggplot () +
geom_line (aes (x = date, y = cum_resid, group = site_name, color = site_name)) +
geom_hline (aes (yintercept = 0 ), linetype = "dashed" ) +
xlab ("" ) + ylab ("ln(Yield) cumulative residuals " ) + labs (color = "Little g" ) +
theme_bw () + theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank ()))
dev.off ()
}
```
Write function to generate flow story plot
```{r}
bigplotfun <- function (mybasin, mysubbasin, CY, little, big, super, supergyears, mymap, evalyears) {
#### essential elements
dat_basin <- dat %>% filter (basin == mybasin)
months <- c ("Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" , "Jan" , "Feb" , "Mar" )
fudge <- 0.01 # add small value to deal with 0 flow on log scale
# clean data...drop all dates that have missing data at any site
dat_basin_cy_clean <- dat %>%
filter (site_name %in% c (little, big), WaterYear == CY) %>%
select (date, site_name, Yield_filled_mm_7) %>%
spread (key = site_name, value = Yield_filled_mm_7) %>%
drop_na () %>%
gather (key = site_name, value = Yield_filled_mm_7, 2 : ncol (.))
dat_basin_cy_clean <- fill_missing_dates (dat_basin_cy_clean, dates = "date" , groups = "site_name" , pad_ends = FALSE )
# get among-year yield min/max for y-axis limits
dat_basin_sub <- dat %>%
filter (site_name %in% c (little, big), WaterYear %in% evalyears) %>%
select (date, WaterYear, site_name, Yield_filled_mm_7) %>%
spread (key = site_name, value = Yield_filled_mm_7) %>%
drop_na () %>%
gather (key = site_name, value = Yield_filled_mm_7, 3 : ncol (.)) %>%
filter (! is.na (Yield_filled_mm_7)) %>%
mutate (Yield_filled_mm_7_log = log (Yield_filled_mm_7+ fudge))
yield_lim <- range (dat_basin_sub$ Yield_filled_mm_7_log)
# clean months
cleanmonths <- unlist (dat_basin_cy_clean %>% filter (site_name == little[1 ]) %>% drop_na () %>% left_join (dat_basin %>% select (date, site_name, MonthName, Month)) %>% group_by (MonthName) %>% summarize (ndays = n ()) %>% filter (ndays >= 20 ) %>% select (MonthName))
#### MAP
p1 <- mymap
# print("p1")
#### HYDROGRAPHS IN YIELD
p2 <- ggplot () +
geom_line (data = dat_basin_cy_clean %>% filter (site_name %in% little) %>% mutate (site_name = factor (site_name, levels = little)), aes (x = date, y = log (Yield_filled_mm_7+ fudge), group = site_name, color = site_name)) +
geom_line (data = dat_basin_cy_clean %>% filter (site_name == big), aes (x = date, y = log (Yield_filled_mm_7+ fudge)), color = "black" , size = 1.25 ) +
xlab ("Date" ) + ylab ("ln(Yield, mm)" ) + theme_bw () + ylim (yield_lim) +
scale_x_date (limits = as.Date (c (paste (CY-1 , '-04-01' , sep = "" ), paste (CY, '-04-01' , sep = "" )))) +
theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank (), legend.position = "none" )
# print("p2")
#### TOTAL ANNUAL YIELD
# get total yield per year and convert to percentiles
yeartotals <- dat_basin %>%
filter (site_name == super, WaterYear %in% supergyears) %>%
group_by (WaterYear) %>%
summarize (totalyield = sum (Yield_filled_mm, na.rm = TRUE )) %>%
filter (! is.na (totalyield)) %>%
mutate (percentile = percent_rank (totalyield))
p3 <- ggplot () +
geom_line (data = yeartotals, aes (x = WaterYear, y = totalyield), color = "grey40" ) +
geom_point (data = yeartotals %>% filter (WaterYear == CY), aes (x = WaterYear, y = totalyield)) +
xlab ("Climate year" ) + ylab ("Total annual yield (mm)" ) + theme_bw () +
theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank ())
# print("p3")
#### EXCEEDANCE PROBABILITY - SUPER G PERIOD OF RECORD
exceedance <- dat_basin %>%
filter (site_name %in% c (little, big, super)) %>%
filter (! is.na (Yield_filled_mm_7)) %>%
mutate (Yield_filled_mm_7_log = log (Yield_filled_mm_7)) %>%
group_by (site_name, WaterYear) %>%
arrange (desc (Yield_filled_mm_7_log), .by_group = TRUE ) %>%
mutate (exceedance = 100 / length (Yield_filled_mm_7_log)* 1 : length (Yield_filled_mm_7_log)) %>%
ungroup ()
p4 <- ggplot () +
geom_line (data = exceedance %>% filter (site_name == super, WaterYear %in% supergyears), aes (x = exceedance, y = Yield_filled_mm_7_log, group = WaterYear, color = WaterYear), size = 0.25 ) +
geom_line (data = exceedance %>% filter (site_name == super, WaterYear == CY), aes (x = exceedance, y = Yield_filled_mm_7_log), color = "black" , size = 1.25 ) +
geom_text (aes (x = 50 , y = Inf , label = paste ("Super G: " , super, " (" , min (supergyears), "-" , max (supergyears), ")" , " \n Current year: " , CY, " (" , round (yeartotals$ percentile[yeartotals$ WaterYear == CY]* 100 ), "th perc.)" , sep = "" )), vjust = 1.2 ) +
scale_color_continuous (trans = "reverse" ) +
xlab ("Exceedance probability" ) + ylab ("ln(Yield, mm)" ) + labs (color = "Climate year" ) + theme_bw () +
theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank (), legend.position = c (0.15 ,0.23 ),
legend.text = element_text (size = 9 ), legend.title = element_text (size = 9 ), legend.key.height = unit (0.4 , "cm" ))
# print("p4")
#### CUMULATIVE YIELD RESIDUALS
# get range of residuals among years
dat_basin_res <- dat_basin_sub %>%
filter (site_name %in% little, WaterYear %in% evalyears) %>% select (site_name, date, WaterYear, Yield_filled_mm_7) %>%
left_join (dat %>% filter (site_name == big) %>% rename (bigyield = Yield_filled_mm_7) %>% select (date, WaterYear, bigyield)) %>%
mutate (delta_yield = log (Yield_filled_mm_7+ fudge) - log (bigyield+ fudge), site_name = factor (site_name, levels = little)) %>%
group_by (site_name, WaterYear) %>% mutate (cum_resid = cumsum (coalesce (delta_yield, 0 )) + delta_yield* 0 )
res_lim <- range (dat_basin_res$ cum_resid, na.rm = TRUE )
p5 <- dat_basin_cy_clean %>% filter (site_name %in% little) %>%
left_join (dat_basin_cy_clean %>% filter (site_name == big) %>% rename (bigyield = Yield_filled_mm_7) %>% select (- site_name)) %>%
mutate (delta_yield = log (Yield_filled_mm_7+ fudge) - log (bigyield+ fudge), site_name = factor (site_name, levels = little)) %>%
group_by (site_name) %>% mutate (cum_resid = cumsum (coalesce (delta_yield, 0 )) + delta_yield* 0 ) %>%
ggplot () +
geom_line (aes (x = date, y = cum_resid, group = site_name, color = site_name)) +
geom_hline (aes (yintercept = 0 ), linetype = "dashed" ) +
xlab ("Date" ) + ylab ("ln(Yield) cumulative residuals " ) + ylim (res_lim) +
scale_x_date (limits = as.Date (c (paste (CY-1 , '-04-01' , sep = "" ), paste (CY, '-04-01' , sep = "" )))) +
theme_bw () + theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank (), legend.position = "none" )
# print("p5")
#### EXCEEDANCE PROBABILITY - BIG G/LITTLE G CURRENT YEAR
exceedance <- dat_basin_cy_clean %>%
filter (site_name %in% c (little, big)) %>%
filter (! is.na (Yield_filled_mm_7)) %>%
mutate (Yield_filled_mm_7_log = log (Yield_filled_mm_7+ fudge)) %>%
group_by (site_name) %>%
arrange (desc (Yield_filled_mm_7_log), .by_group = TRUE ) %>%
mutate (exceedance = 100 / length (Yield_filled_mm_7_log)* 1 : length (Yield_filled_mm_7_log)) %>%
ungroup ()
p6 <- ggplot () +
geom_line (data = exceedance %>% filter (site_name %in% little) %>% mutate (site_name = factor (site_name, levels = little)), aes (x = exceedance, y = Yield_filled_mm_7_log, group = site_name, color = site_name)) +
geom_line (data = exceedance %>% filter (site_name == big), aes (x = exceedance, y = Yield_filled_mm_7_log), color = "black" , size = 1.25 ) +
xlab ("Exceedance probability" ) + ylab ("ln(Yield, mm)" ) + labs (color = "Little g" ) + theme_bw () + ylim (yield_lim) +
theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank (), legend.position = "none" )
# print("p6")
#### EXCEEDANCE PROBABILITY MONTHLY
exceedance_monthly <- dat_basin_cy_clean %>%
filter (site_name %in% c (little, big)) %>%
filter (! is.na (Yield_filled_mm_7)) %>%
left_join (dat_basin %>% select (date, site_name, MonthName, Month)) %>%
mutate (Yield_filled_mm_7_log = log (Yield_filled_mm_7+ fudge),
site_name = factor (site_name, levels = c (little, big)),
MonthName = factor (MonthName, levels = months)) %>%
group_by (site_name, Month) %>%
arrange (desc (Yield_filled_mm_7_log), .by_group = TRUE ) %>%
mutate (exceedance = 100 / length (Yield_filled_mm_7_log)* 1 : length (Yield_filled_mm_7_log)) %>%
ungroup ()
exceedance_monthly2 <- exceedance_monthly %>% mutate (Yield_filled_mm_7_log = ifelse (MonthName %in% cleanmonths, Yield_filled_mm_7_log, NA ))
p7 <- ggplot () +
geom_line (data = exceedance_monthly2 %>% filter (site_name %in% little), aes (x = exceedance, y = Yield_filled_mm_7_log, group = site_name, color = site_name)) +
geom_line (data = exceedance_monthly2 %>% filter (site_name == big), aes (x = exceedance, y = Yield_filled_mm_7_log), color = "black" , size = 1.25 ) +
facet_wrap (~ factor (MonthName), nrow = 2 ) +
xlab ("Exceedance probability" ) + ylab ("ln(Yield, mm)" ) + labs (color = "Little g" ) + theme_bw () + ylim (yield_lim) +
theme (panel.grid.major = element_blank (), panel.grid.minor = element_blank (), legend.position = "none" )
# print("p7")
#### ANNUAL BIG-LITTLE DIFFERENCE
mypvals <- tibble (type = rep (NA , times = length (little)),
month = rep (NA , times = length (little)),
site_name = rep (NA , times = length (little)),
stat = rep (NA , times = length (little)),
pval = rep (NA , times = length (little)))
for (i in 1 : length (little)) {
mytest <- ks.test (exceedance$ Yield_filled_mm_7_log[exceedance$ site_name == big],
exceedance$ Yield_filled_mm_7_log[exceedance$ site_name == little[i]], exact = TRUE )
mypvals$ type <- "annual"
mypvals$ month <- 0
mypvals$ site_name[i] <- little[i]
mypvals$ stat[i] <- mytest$ statistic
mypvals$ pval[i] <- mytest$ p.value
}
p8 <- mypvals %>%
mutate (site_name = factor (site_name, levels = little)) %>%
ggplot () +
geom_boxplot (aes (x = month, y = pval, group = month), fill = "grey90" , outlier.shape = NA ) +
geom_point (aes (x = jitter (month, factor = 10 ), y = pval, color = site_name), size = 2 ) +
ylim (0 ,1 ) + geom_hline (yintercept = 0.05 , linetype = "dashed" ) +
xlab ("" ) + ylab ("Kolmogorov-Smirnov test p-value" ) + scale_x_continuous (labels = "Annual" , breaks = 0 ) +
theme_bw () + theme (axis.title.x = element_blank (), panel.grid.minor = element_blank (), legend.position = "none" )
# print("p8")
#### MONTHLY BIG-LITTLE DIFFERENCE
mypvals_monthly_list <- list ()
for (i in 1 : length (little)) {
mypvals_monthly <- tibble (type = rep (NA , times = 12 ),
month = rep (NA , times = 12 ),
site_name = rep (NA , times = 12 ),
stat = rep (NA , times = 12 ),
pval = rep (NA , times = 12 ))
for (j in 1 : 12 ) {
big_exc <- exceedance_monthly$ Yield_filled_mm_7_log[exceedance_monthly$ site_name == big & exceedance_monthly$ MonthName == months[j]]
lit_exc <- exceedance_monthly$ Yield_filled_mm_7_log[exceedance_monthly$ site_name == little[i] & exceedance_monthly$ MonthName == months[j]]
if (length (lit_exc) < 20 ) {
mypvals_monthly$ site_name[j] <- little[i]
mypvals_monthly$ type <- "monthly"
mypvals_monthly$ month[j] <- months[j]
mypvals_monthly$ stat[j] <- NA
mypvals_monthly$ pval[j] <- NA
} else {
mytest <- ks.test (big_exc, lit_exc, exact = TRUE )
mypvals_monthly$ site_name[j] <- little[i]
mypvals_monthly$ type <- "monthly"
mypvals_monthly$ month[j] <- months[j]
mypvals_monthly$ stat[j] <- mytest$ statistic
mypvals_monthly$ pval[j] <- mytest$ p.value
}
}
mypvals_monthly_list[[i]] <- mypvals_monthly
}
mypvals_monthly <- do.call (rbind, mypvals_monthly_list) %>%
mutate (site_name = factor (site_name, levels = little),
month = factor (month, levels = months),
month_num = as.numeric (month))
# compute the loess
# dum <- rbind(mypvals_monthly %>% mutate(month_num = month_num-12),
# mypvals_monthly,
# mypvals_monthly %>% mutate(month_num = month_num+12))
# mylo <- loess(pval ~ month_num, dum, span = 0.25)
# plot(pval ~ month_num, dum)
# j <- order(dum$month_num)[(dim(mypvals_monthly)[1]+1):(dim(mypvals_monthly)[1]+dim(mypvals_monthly)[1])]
# lines(dum$month_num[j], mylo$fitted[j], col = "red")
# the plot
p9 <- mypvals_monthly %>%
ggplot () +
geom_boxplot (aes (x = month, y = pval, group = month), fill = "grey90" , outlier.shape = NA ) +
# geom_line(aes(x = dum$month_num[j], y = mylo$fitted[j]), linewidth = 1.25) +
geom_smooth (aes (x = month_num, y = pval), linewidth = 1.25 , color = "black" , se = FALSE ) +
geom_point (aes (x = jitter (month_num), y = pval, color = site_name), size = 2 ) +
ylim (0 ,1 ) + geom_hline (yintercept = (0.05 ), linetype = "dashed" ) +
xlab ("" ) + ylab ("" ) +
labs (color = "" ) + theme_bw () +
theme (axis.title.x = element_blank (), axis.text.y = element_blank (), panel.grid.minor = element_blank ())
# print("p9")
#### BIG PLOT
bigp <- ggarrange (ggarrange (mymap, ggarrange (NA , p2, nrow = 2 , heights = c (0.2 ,1 ))),
ggarrange (p3, p4),
ggarrange (p5, p6),
p7,
ggarrange (p8, p9, widths = c (0.13 , 0.85 )), nrow = 5 , heights = c (1.2 ,0.9 ,0.9 ,1.2 ,0.9 ))
# print("big plot!")
# write out
# jpeg(paste("Big G Little g/Compare Distributions/BigGLittleG_BigPlot_", mybasin, "_", mysubbasin, "_", CY, ".jpg", sep = ""), height = 18, width = 10, units = "in", res = 500)
# annotate_figure(bigp, fig.lab = "The West Brook, CY 2021", fig.lab.pos = "top.right", fig.lab.size = 24)
print (annotate_figure (bigp, top = text_grob (paste (mybasin, ", CY " , CY, sep = "" ), x = 0.75 , y = - 0.5 , just = "centre" , size = 24 )))
# dev.off()
}
```
## Create map objects
```{r WEST BROOK, echo=FALSE}
mysheds <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Watersheds/Mass_Watersheds.shp")
mysheds <- mysheds[mysheds$site_id == "WBR",]
mynet <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Streams/Mass_Streams.shp")
crs(mynet) <- crs(mysheds)
mynet <- crop(mynet, mysheds)
# hillshade
myrast <- rast("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/Spatial data/Elevation/WestBrook_DEM_10m_nc.tif")
myrast <- mask(crop(myrast, mysheds), mysheds)
slo <- terrain(myrast, "slope", unit = "radians")
asp <- terrain(myrast, "aspect", unit = "radians")
hill <- shade(slope = slo, aspect = asp, angle = 40, direction = 270)
hilldf <- as.data.frame(hill, xy = TRUE)
# get lakes
lakes <- get_waterbodies(AOI = siteinfo_sp %>% filter(site_name == "West Brook NWIS"), buffer = 10000)
lakes <- lakes %>% filter(gnis_name %in% c("Northampton Reservoir Upper", "Northampton Reservoir"))
# little g points
mylittleg <- siteinfo_sp %>% filter(site_name %in% c("West Brook Lower", "Mitchell Brook", "Jimmy Brook", "Obear Brook Lower", "West Brook Upper", "West Brook Reservoir", "Sanderson Brook", "Avery Brook", "West Whately Brook")) %>% mutate(site_name = factor(site_name, levels = c("West Brook Lower", "Mitchell Brook", "Jimmy Brook", "Obear Brook Lower", "West Brook Upper", "West Brook Reservoir", "Sanderson Brook", "Avery Brook", "West Whately Brook")))
mybigg <- siteinfo_sp %>% filter(site_name == "West Brook NWIS")
# create map
p1_WB <- ggplot() +
geom_raster(data = hilldf, aes(x = x, y = y, fill = hillshade), show.legend = FALSE) +
scale_fill_distiller(palette = "Greys") +
geom_sf(data = st_as_sf(mysheds), color = "black", fill = NA, linewidth = 0.4) +
geom_sf(data = st_as_sf(mynet), color = "royalblue4", linewidth = 1) +
geom_sf(data = lakes, color = "royalblue4", fill = "lightskyblue1", linewidth = 0.5) +
geom_sf(data = mylittleg, aes(color = site_name), size = 3) +
geom_sf(data = mylittleg, shape = 1, size = 3) +
geom_sf(data = mybigg, size = 4) + geom_sf(data = mybigg, color = "white", size = 2.5) +
labs(color = "") + annotation_scale() +
theme_bw() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none")
rm("mysheds", "mynet", "myrast", "slo", "asp", "hill", "hilldf", "lakes", "mylittleg", "mybigg")
```
```{r STAUNTON RIVER, echo=FALSE}
mysheds <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Watersheds/Shen_Watersheds.shp")
mysheds <- mysheds[mysheds$site_id == "SR_10FL",]
mynet <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Streams/Shen_Streams.shp")
crs(mynet) <- crs(mysheds)
mynet <- crop(mynet, mysheds)
# hillshade
myrast <- rast("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/Spatial data/Elevation/Shenandoah_DEM_10m_nc.tif")
myrast <- mask(crop(myrast, mysheds), mysheds)
slo <- terrain(myrast, "slope", unit = "radians")
asp <- terrain(myrast, "aspect", unit = "radians")
hill <- shade(slope = slo, aspect = asp, angle = 40, direction = 270)
hilldf <- as.data.frame(hill, xy = TRUE)
# little g points
mylittleg <- siteinfo_sp %>% filter(site_name %in% c("Staunton River 09", "Staunton River 07", "Staunton River 06", "Staunton River 03", "Staunton River 02")) %>% mutate(site_name = factor(site_name, levels = c("Staunton River 09", "Staunton River 07", "Staunton River 06", "Staunton River 03", "Staunton River 02")))
mybigg <- siteinfo_sp %>% filter(site_name == "Staunton River 10")
# create map
p1_ST <- ggplot() +
geom_raster(data = hilldf, aes(x = x, y = y, fill = hillshade), show.legend = FALSE) +
scale_fill_distiller(palette = "Greys") +
geom_sf(data = st_as_sf(mysheds), color = "black", fill = NA, linewidth = 0.4) +
geom_sf(data = st_as_sf(mynet), color = "royalblue4", linewidth = 1) +
# geom_sf(data = lakes, color = "royalblue4", fill = "lightskyblue1", linewidth = 0.5) +
geom_sf(data = mylittleg, aes(color = site_name), size = 3) +
geom_sf(data = mylittleg, shape = 1, size = 3) +
geom_sf(data = mybigg, size = 4) + geom_sf(data = mybigg, color = "white", size = 2.5) +
labs(color = "") + annotation_scale() +
theme_bw() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none")
rm("mysheds", "mynet", "myrast", "slo", "asp", "hill", "hilldf", "lakes", "mylittleg", "mybigg")
```
```{r PAINE RUN, echo=FALSE}
mysheds <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Watersheds/Shen_Watersheds.shp")
mysheds <- mysheds[mysheds$site_id == "PA_10FL",]
mynet <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Streams/Shen_Streams.shp")
crs(mynet) <- crs(mysheds)
mynet <- crop(mynet, mysheds)
# hillshade
myrast <- rast("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/Spatial data/Elevation/Shenandoah_DEM_10m_nc.tif")
myrast <- mask(crop(myrast, mysheds), mysheds)
slo <- terrain(myrast, "slope", unit = "radians")
asp <- terrain(myrast, "aspect", unit = "radians")
hill <- shade(slope = slo, aspect = asp, angle = 40, direction = 270)
hilldf <- as.data.frame(hill, xy = TRUE)
# little g points
mylittleg <- siteinfo_sp %>% filter(site_name %in% c("Paine Run 08", "Paine Run 07", "Paine Run 06", "Paine Run 02", "Paine Run 01")) %>% mutate(site_name = factor(site_name, levels = c("Paine Run 08", "Paine Run 07", "Paine Run 06", "Paine Run 02", "Paine Run 01")))
mybigg <- siteinfo_sp %>% filter(site_name == "Paine Run 10")
# create map
p1_PA <- ggplot() +
geom_raster(data = hilldf, aes(x = x, y = y, fill = hillshade), show.legend = FALSE) +
scale_fill_distiller(palette = "Greys") +
geom_sf(data = st_as_sf(mysheds), color = "black", fill = NA, linewidth = 0.4) +
geom_sf(data = st_as_sf(mynet), color = "royalblue4", linewidth = 1) +
geom_sf(data = mylittleg, aes(color = site_name), size = 3) +
geom_sf(data = mylittleg, shape = 1, size = 3) +
geom_sf(data = mybigg, size = 4) + geom_sf(data = mybigg, color = "white", size = 2.5) +
labs(color = "") + annotation_scale(location = "tl") +
theme_bw() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none")
rm("mysheds", "mynet", "myrast", "slo", "asp", "hill", "hilldf", "lakes", "mylittleg", "mybigg")
```
```{r BIG CREEK FLAT, echo=FALSE}
mysheds <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Watersheds/Flat_Watersheds.shp")
mysheds <- mysheds[mysheds$site_id == "BIG_001",]
mynet <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Streams/Flat_Streams.shp")
crs(mynet) <- crs(mysheds)
mynet <- crop(mynet, mysheds)
# hillshade
myrast <- rast("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/Spatial data/Elevation/NorthForkFlathead_DEM_10m_nc.tif")
myrast <- mask(crop(myrast, mysheds), mysheds)
slo <- terrain(myrast, "slope", unit = "radians")
asp <- terrain(myrast, "aspect", unit = "radians")
hill <- shade(slope = slo, aspect = asp, angle = 40, direction = 270)
hilldf <- as.data.frame(hill, xy = TRUE)
# get lakes
lakes <- get_waterbodies(AOI = siteinfo_sp %>% filter(site_name == "North Fork Flathead River NWIS"), buffer = 100000)
lakes <- st_transform(lakes, crs(mysheds))
lakes <- st_intersection(lakes, st_as_sf(mysheds))
# lakes <- lakes %>% filter(gnis_name %in% c("Moose Lake", "Mud Lake", "Cyclone Lake", "Winona Lake", "Logging Lake", "Quartz Lake",
# "Rogers Lake", "Trout Lake", "Middle Quartz Lake", "Lower Quartz Lake", "Kintla Lake", "Bowman Lake"))
lakes <- lakes %>% filter(gnis_name %in% c("Moose Lake", "Mud Lake"))
# points
# mylevels <- c("BigCreekLower", "LangfordCreekLower", "LangfordCreekUpper", "BigCreekMiddle", "BigCreekUpper", "HallowattCreekLower", "SkookoleelCreek", "NicolaCreek", "WernerCreek",
# "McGeeCreekTrib", "McGeeCreekLower", "McGeeCreekUpper",
# "CoalCreekLower", "MeadowCreek", "CycloneCreekLower", "CycloneCreekMiddle", "CycloneCreekUpper", "CoalCreekMiddle", "CoalCreekNorth", "CoalCreekHeadwaters")
mylevels <- c("BigCreekMiddle", "BigCreekUpper", "HallowattCreekLower", "WernerCreek", "Hallowat Creek NWIS", "NicolaCreek")
mylittleg <- siteinfo_sp %>% filter(site_name %in% mylevels) %>% mutate(site_name = factor(site_name, levels = mylevels))
# edit geometry to reduce overlap
st_geometry(mylittleg)[mylittleg$site_name == "BigCreekUpper"] <- st_point(c(-114.31506, 48.57672))
st_geometry(mylittleg)[mylittleg$site_name == "HallowattCreekLower"] <- st_point(c(-114.31914, 48.57256))
mybigg <- siteinfo_sp %>% filter(site_name == "BigCreekLower")
# create map
# mapview(mynet$UT_flowlines) + mapview((lakes)) + mapview(siteinfo_sp %>% filter(basin == "West Brook"))
p1_FLBC <- ggplot() +
geom_raster(data = hilldf, aes(x = x, y = y, fill = hillshade), show.legend = FALSE) +
scale_fill_distiller(palette = "Greys") +
geom_sf(data = st_as_sf(mysheds), color = "black", fill = NA, linewidth = 0.4) +
geom_sf(data = st_as_sf(mynet), color = "royalblue4", linewidth = 1) +
geom_sf(data = lakes, color = "royalblue4", fill = "lightskyblue1", linewidth = 0.5) +
geom_sf(data = mylittleg, aes(color = site_name), size = 3) +
geom_sf(data = mylittleg, shape = 1, size = 3) +
geom_sf(data = mybigg, size = 4) + geom_sf(data = mybigg, color = "white", size = 2.5) +
labs(color = "") + annotation_scale() +
# scale_x_continuous(limits = c(-114.525,-114), expand = c(0,0)) + scale_y_continuous(limits = c(48.475,48.75), expand = c(0,0)) +
theme_bw() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none")
rm("mysheds", "mynet", "myrast", "slo", "asp", "hill", "hilldf", "lakes", "mylittleg", "mybigg")
```
```{r SPREAD CREEK SNAKE, echo=FALSE}
mysheds <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Watersheds/Snake_Watersheds.shp")
mysheds <- mysheds[mysheds$site_id == "SP11",]
mynet <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Streams/Snake_Streams.shp")
crs(mynet) <- crs(mysheds)
mynet <- crop(mynet, mysheds)
# hillshade
myrast <- rast("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/Spatial data/Elevation/SpreadCreek_DEM_10m_nc.tif")
myrast <- mask(crop(myrast, mysheds), mysheds)
slo <- terrain(myrast, "slope", unit = "radians")
asp <- terrain(myrast, "aspect", unit = "radians")
hill <- shade(slope = slo, aspect = asp, angle = 40, direction = 270)
hilldf <- as.data.frame(hill, xy = TRUE)
# get lakes
lakes <- get_waterbodies(AOI = siteinfo_sp %>% filter(site_name == "Spread Creek Dam"), buffer = 100000)
lakes <- st_transform(lakes, crs(mysheds))
lakes <- st_intersection(lakes, st_as_sf(mysheds))
lakes <- lakes %>% filter(gnis_name %in% c("Leidy Lake"))
# points
mylevels <- c("Rock Creek", "SF Spread Creek Lower NWIS", "Grouse Creek", "SF Spread Creek Upper", "Leidy Creek Mouth NWIS", "Leidy Creek Upper", "NF Spread Creek Lower", "NF Spread Creek Upper", "Grizzly Creek")
mylittleg <- siteinfo_sp %>% filter(site_name %in% mylevels) %>% mutate(site_name = factor(site_name, levels = mylevels))
# edit geometry to reduce overlap
st_geometry(mylittleg)[mylittleg$site_name == "SF Spread Creek Lower NWIS"] <- st_point(c(-110.32226, 43.76118))
st_geometry(mylittleg)[mylittleg$site_name == "NF Spread Creek Lower"] <- st_point(c(-110.3199, 43.766533))
st_geometry(mylittleg)[mylittleg$site_name == "Grizzly Creek"] <- st_point(c(-110.23289, 43.77433))
st_geometry(mylittleg)[mylittleg$site_name == "NF Spread Creek Upper"] <- st_point(c(-110.23405, 43.77227))
st_geometry(mylittleg)[mylittleg$site_name == "SF Spread Creek Upper"] <- st_point(c(-110.31475, 43.73661))
mybigg <- siteinfo_sp %>% filter(site_name == "Spread Creek Dam")
# create map
# mapview(mynet$UT_flowlines) + mapview((lakes)) + mapview(siteinfo_sp %>% filter(basin == "West Brook"))
p1_SC <- ggplot() +
geom_raster(data = hilldf, aes(x = x, y = y, fill = hillshade), show.legend = FALSE) +
scale_fill_distiller(palette = "Greys") +
geom_sf(data = st_as_sf(mysheds), color = "black", fill = NA, linewidth = 0.4) +
geom_sf(data = st_as_sf(mynet), color = "royalblue4", linewidth = 1) +
geom_sf(data = lakes, color = "royalblue4", fill = "lightskyblue1", linewidth = 0.5) +
geom_sf(data = mylittleg, aes(color = site_name), size = 3) +
geom_sf(data = mylittleg, shape = 1, size = 3) +
geom_sf(data = mybigg, size = 4) + geom_sf(data = mybigg, color = "white", size = 2.5) +
labs(color = "") + annotation_scale() +
theme_bw() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none")
rm("mysheds", "mynet", "myrast", "slo", "asp", "hill", "hilldf", "lakes", "mylittleg", "mybigg")
```
```{r DONNER BLITZEN, echo=FALSE}
mysheds <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Watersheds/Oreg_Watersheds.shp")
mysheds <- mysheds[mysheds$site_id == "DBF",]
mynet <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Streams/Oreg_Streams.shp")
crs(mynet) <- crs(mysheds)
mynet <- crop(mynet, mysheds)
# hillshade
myrast <- rast("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/Spatial data/Elevation/DonnerBlitzen_DEM_10m_nc.tif")
myrast <- mask(crop(myrast, mysheds), mysheds)
slo <- terrain(myrast, "slope", unit = "radians")
asp <- terrain(myrast, "aspect", unit = "radians")
hill <- shade(slope = slo, aspect = asp, angle = 40, direction = 270)
hilldf <- as.data.frame(hill, xy = TRUE)
# points
mylevels <- c("Donner Blitzen ab Fish NWIS", "Fish Creek", "Donner Blitzen nr Burnt Car NWIS", "Donner Blitzen ab Indian NWIS")
mylittleg <- siteinfo_sp %>% filter(site_name %in% mylevels) %>% mutate(site_name = factor(site_name, levels = mylevels))
# edit geometry to reduce overlap
st_geometry(mylittleg)[mylittleg$site_name == "Donner Blitzen ab Fish NWIS"] <- st_point(c(-118.84315, 42.75476))
st_geometry(mylittleg)[mylittleg$site_name == "Fish Creek"] <- st_point(c(-118.83173, 42.75911))
mybigg <- siteinfo_sp %>% filter(site_name == "Donner Blitzen River nr Frenchglen NWIS")
# create map
# mapview(mynet$UT_flowlines) + mapview((lakes)) + mapview(siteinfo_sp %>% filter(basin == "West Brook"))
p1_DB <- ggplot() +
geom_raster(data = hilldf, aes(x = x, y = y, fill = hillshade), show.legend = FALSE) +
scale_fill_distiller(palette = "Greys") +
geom_sf(data = st_as_sf(mysheds), color = "black", fill = NA, linewidth = 0.4) +
geom_sf(data = st_as_sf(mynet), color = "royalblue4", linewidth = 1) +
geom_sf(data = mylittleg, aes(color = site_name), size = 3) +
geom_sf(data = mylittleg, shape = 1, size = 3) +
geom_sf(data = mybigg, size = 4) + geom_sf(data = mybigg, color = "white", size = 2.5) +
labs(color = "") + annotation_scale() +
theme_bw() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none")
rm("mysheds", "mynet", "myrast", "slo", "asp", "hill", "hilldf", "lakes", "mylittleg", "mybigg")
```
```{r SHIELDS RIVER, echo=FALSE}
mysheds <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Watersheds/Shields_Watersheds.shp")
mysheds <- mysheds[mysheds$site_id == "SRS",]
mynet <- vect("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/EcoDrought-Analysis/Watershed Delineation/Streams/Shields_Streams.shp")
crs(mynet) <- crs(mysheds)
mynet <- crop(mynet, mysheds)
# hillshade
myrast <- rast("C:/Users/jbaldock/OneDrive - DOI/Documents/USGS/EcoDrought/EcoDrought Working/Data/Spatial data/Elevation/Shields_DEM_10m_nc.tif")
myrast <- mask(crop(myrast, mysheds), mysheds)
slo <- terrain(myrast, "slope", unit = "radians")
asp <- terrain(myrast, "aspect", unit = "radians")
hill <- shade(slope = slo, aspect = asp, angle = 40, direction = 270)
hilldf <- as.data.frame(hill, xy = TRUE)
# points
mylevels <- c("Deep Creek", "Crandall Creek", "Buck Creek", "Dugout Creek NWIS", "Lodgepole Creek")
mylittleg <- siteinfo_sp %>% filter(site_name %in% mylevels) %>% mutate(site_name = factor(site_name, levels = mylevels))
mybigg <- siteinfo_sp %>% filter(site_name == "Shields River ab Smith NWIS")
# create map
# mapview(mynet$UT_flowlines) + mapview((lakes)) + mapview(siteinfo_sp %>% filter(basin == "West Brook"))
p1_SH <- ggplot() +
geom_raster(data = hilldf, aes(x = x, y = y, fill = hillshade), show.legend = FALSE) +
scale_fill_distiller(palette = "Greys") +
geom_sf(data = st_as_sf(mysheds), color = "black", fill = NA, linewidth = 0.4) +
geom_sf(data = st_as_sf(mynet), color = "royalblue4", linewidth = 1) +
geom_sf(data = mylittleg, aes(color = site_name), size = 3) +
geom_sf(data = mylittleg, shape = 1, size = 3) +
geom_sf(data = mybigg, size = 4) + geom_sf(data = mybigg, color = "white", size = 2.5) +
labs(color = "") + annotation_scale() +
theme_bw() + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), legend.position = "none")
rm("mysheds", "mynet", "myrast", "slo", "asp", "hill", "hilldf", "lakes", "mylittleg", "mybigg")
```
::: panel-tabset
#### West Brook
```{r, echo=FALSE}
p1_WB
```
#### Staunton River
```{r, echo=FALSE}
p1_ST
```
#### Paine Run
```{r, echo=FALSE}
p1_PA
```
#### Big Creek
```{r, echo=FALSE}
p1_FLBC
```
#### Spread Creek
```{r, echo=FALSE}
p1_SC
```
#### Shields River
```{r, echo=FALSE}
p1_SH
```
#### Donner-Blitzen
```{r, echo=FALSE}
p1_DB
```
:::
## Flow story plots
Generate streamflow story plots by basin and climate year
### West Brook
::: panel-tabset
#### 2021
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "West Brook",
CY = 2021,
little = c("West Brook Lower", "Mitchell Brook", "Jimmy Brook", "Obear Brook Lower", "West Brook Upper", "West Brook Reservoir", "Sanderson Brook", "Avery Brook", "West Whately Brook"),
big = "West Brook NWIS",
super = "South River Conway NWIS",
mymap = p1_WB,
supergyears = c(1981:2024),
evalyears = c(2021:2022))
```
#### 2022
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "West Brook",
CY = 2022,
little = c("West Brook Lower", "Mitchell Brook", "Jimmy Brook", "Obear Brook Lower", "West Brook Upper", "West Brook Reservoir", "Sanderson Brook", "Avery Brook", "West Whately Brook"),
big = "West Brook NWIS",
super = "South River Conway NWIS",
mymap = p1_WB,
supergyears = c(1981:2024),
evalyears = c(2021:2022))
```
:::
### Staunton River
::: panel-tabset
#### 2021
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Staunton River",
CY = 2021,
little = c("Staunton River 09", "Staunton River 07", "Staunton River 06", "Staunton River 03", "Staunton River 02"),
big = "Staunton River 10",
super = "Staunton River 10",
mymap = p1_ST,
supergyears = c(1994:2023),
evalyears = c(2021:2023))
```
#### 2022
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Staunton River",
CY = 2022,
little = c("Staunton River 09", "Staunton River 07", "Staunton River 06", "Staunton River 03", "Staunton River 02"),
big = "Staunton River 10",
super = "Staunton River 10",
mymap = p1_ST,
supergyears = c(1994:2023),
evalyears = c(2021:2023))
```
#### 2023
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Staunton River",
CY = 2023,
little = c("Staunton River 09", "Staunton River 07", "Staunton River 06", "Staunton River 03", "Staunton River 02"),
big = "Staunton River 10",
super = "Staunton River 10",
mymap = p1_ST,
supergyears = c(1994:2023),
evalyears = c(2021:2023))
```
:::
### Paine Run
::: panel-tabset
#### 2021
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Paine Run",
CY = 2021,
little = c("Paine Run 08", "Paine Run 07", "Paine Run 06", "Paine Run 02", "Paine Run 01"),
big = "Paine Run 10",
super = "Paine Run 10",
mymap = p1_PA,
supergyears = c(1994:2023),
evalyears = c(2021:2022))
```
#### 2022
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Paine Run",
CY = 2022,
little = c("Paine Run 08", "Paine Run 07", "Paine Run 06", "Paine Run 02", "Paine Run 01"),
big = "Paine Run 10",
super = "Paine Run 10",
mymap = p1_PA,
supergyears = c(1994:2023),
evalyears = c(2021:2022))
```
:::
### Big Creek, Flathead
::: panel-tabset
#### 2020
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Flathead",
mysubbasin = "Big Creek",
CY = 2020,
little = c("BigCreekMiddle", "BigCreekUpper", "HallowattCreekLower", "WernerCreek", "Hallowat Creek NWIS", "NicolaCreek"),
big = "BigCreekLower",
super = "North Fork Flathead River NWIS",
mymap = p1_FLBC,
supergyears = c(1981:2023),
evalyears = c(2019:2021))
```
#### 2021
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Flathead",
mysubbasin = "Big Creek",
CY = 2021,
little = c("BigCreekMiddle", "BigCreekUpper", "HallowattCreekLower", "WernerCreek", "Hallowat Creek NWIS", "NicolaCreek"),
big = "BigCreekLower",
super = "North Fork Flathead River NWIS",
mymap = p1_FLBC,
supergyears = c(1981:2023),
evalyears = c(2019:2021))
```
:::
### Spread Creek, Snake
::: panel-tabset
#### 2022
```{r, echo=FALSE, fig.height=18, fig.width=10, eval=FALSE}
bigplotfun(mybasin = "Snake River",
mysubbasin = NA,
CY = 2022,
little = c("Rock Creek", "SF Spread Creek Lower NWIS", "Grouse Creek", "SF Spread Creek Upper", "Leidy Creek Mouth NWIS", "Leidy Creek Upper", "NF Spread Creek Lower", "NF Spread Creek Upper", "Grizzly Creek"),
big = "Spread Creek Dam",
super = "Pacific Creek at Moran NWIS",
mymap = p1_SC,
supergyears = c(1981:2023),
evalyears = c(2022:2023))
```
#### 2023
```{r, echo=FALSE, fig.height=18, fig.width=10, eval=FALSE}
bigplotfun(mybasin = "Snake River",
mysubbasin = NA,
CY = 2023,
little = c("Rock Creek", "SF Spread Creek Lower NWIS", "Grouse Creek", "SF Spread Creek Upper", "Leidy Creek Mouth NWIS", "Leidy Creek Upper", "NF Spread Creek Lower", "NF Spread Creek Upper", "Grizzly Creek"),
big = "Spread Creek Dam",
super = "Pacific Creek at Moran NWIS",
mymap = p1_SC,
supergyears = c(1981:2023),
evalyears = c(2022:2023))
```
:::
### Shields River
::: panel-tabset
#### 2020
```{r, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Shields River",
mysubbasin = NA,
CY = 2020,
little = c("Deep Creek", "Crandall Creek", "Buck Creek", "Dugout Creek NWIS", "Lodgepole Creek"),
big = "Shields River ab Smith NWIS",
super = "Shields River nr Livingston NWIS",
mymap = p1_SH,
supergyears = c(1981:2023),
evalyears = c(2020,2023))
```
#### 2023
```{r, echo=FALSE, fig.height=18, fig.width=10, eval=FALSE}
bigplotfun(mybasin = "Shields River",
mysubbasin = "Shields River",
CY = 2023,
little = c("Deep Creek", "Crandall Creek", "Buck Creek", "Dugout Creek NWIS", "Lodgepole Creek"),
big = "Shields River ab Smith NWIS",
super = "Shields River nr Livingston NWIS",
mymap = p1_SH,
supergyears = c(1981:2023),
evalyears = c(2020,2023))
```
:::
### Donner-Blitzen
::: panel-tabset
#### 2020
```{r, eval=FALSE, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Donner Blitzen",
mysubbasin = "Donner Blitzen",
CY = 2020,
little = c("Donner Blitzen ab Fish NWIS", "Fish Creek", "Donner Blitzen nr Burnt Car NWIS", "Donner Blitzen ab Indian NWIS"),
big = "Donner Blitzen River nr Frenchglen NWIS",
super = "Donner Blitzen River nr Frenchglen NWIS",
mymap = p1_DB,
supergyears = c(1981:2023),
evalyears = c(2020:2023))
```
#### 2021
```{r, eval=FALSE, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Donner Blitzen",
mysubbasin = "Donner Blitzen",
CY = 2021,
little = c("Donner Blitzen ab Fish NWIS", "Fish Creek", "Donner Blitzen nr Burnt Car NWIS", "Donner Blitzen ab Indian NWIS"),
big = "Donner Blitzen River nr Frenchglen NWIS",
super = "Donner Blitzen River nr Frenchglen NWIS",
mymap = p1_DB,
supergyears = c(1981:2023),
evalyears = c(2020:2023))
```
#### 2022
```{r, eval=FALSE, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Donner Blitzen",
mysubbasin = "Donner Blitzen",
CY = 2022,
little = c("Donner Blitzen ab Fish NWIS", "Fish Creek", "Donner Blitzen nr Burnt Car NWIS", "Donner Blitzen ab Indian NWIS"),
big = "Donner Blitzen River nr Frenchglen NWIS",
super = "Donner Blitzen River nr Frenchglen NWIS",
mymap = p1_DB,
supergyears = c(1981:2023),
evalyears = c(2020:2023))
```
#### 2023
```{r, eval=FALSE, echo=FALSE, fig.height=18, fig.width=10}
bigplotfun(mybasin = "Donner Blitzen",
mysubbasin = "Donner Blitzen",
CY = 2023,
little = c("Donner Blitzen ab Fish NWIS", "Fish Creek", "Donner Blitzen nr Burnt Car NWIS", "Donner Blitzen ab Indian NWIS"),
big = "Donner Blitzen River nr Frenchglen NWIS",
super = "Donner Blitzen River nr Frenchglen NWIS",
mymap = p1_DB,
supergyears = c(1981:2023),
evalyears = c(2020:2023))
```
:::